package com.cjh.controller;

import com.cjh.pojo.Dept;
import com.cjh.pojo.ResultMap;
import com.cjh.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author cjh
 */
@RestController
@RequestMapping("/${spring.application.name}/api")
public class DeptController {

    @Autowired
    private DeptService deptService;

    @GetMapping("/selectDeptList")
    public ResultMap selectDeptList(){

        List<Dept> depts = deptService.selectDeptList();
        return new ResultMap<List<Dept>>(200,"查询所有部分信息",depts,depts.size());
    }
}
